Skip to content

Update multiselect-dropdown.js#11

Open
letheri wants to merge 1 commit into
admirhodzic:mainfrom
letheri:main
Open

Update multiselect-dropdown.js#11
letheri wants to merge 1 commit into
admirhodzic:mainfrom
letheri:main

Conversation

@letheri

@letheri letheri commented Nov 14, 2023

Copy link
Copy Markdown

Check class from option div's removed when select all clicked.

Check class from option div's removed when select all clicked.
@letheri

letheri commented Nov 14, 2023

Copy link
Copy Markdown
Author

Fixes the issue #10.

Comment thread multiselect-dropdown.js
var ch=op.querySelector("input").checked;
list.querySelectorAll(":scope > div:not(.multiselect-dropdown-all-selector)")
.forEach(i=>{if(i.style.display!=='none'){i.querySelector("input").checked=ch; i.optEl.selected=ch}});
.forEach(i=>{if(i.style.display!=='none'){i.querySelector("input").checked=ch; i.classList.remove('checked'); i.optEl.selected=ch}});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not always remove the class, but .toggle('checked', ch) I believe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants